package com.xiaoyun.controller.center;

import com.xiaoyun.pojo.Users;
import com.xiaoyun.service.center.CenterUserService;
import com.xiaoyun.utils.XYJSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Api("center - 用户中心")
@RestController
@RequiredArgsConstructor
@RequestMapping("center")
public class CenterController {
    private final CenterUserService centerUserService;

    @ApiOperation("获取用户信息")
    @PostMapping("userInfo")
    public XYJSONResult userInfo(@RequestParam String userId) {
        Users user = centerUserService.queryUserInfo(userId);
        return XYJSONResult.ok(user);
    }

}
